package example;

public class Stringsql {
	public static void main(String[] args) {

		String string ="this is my name ,my name is %s,my age is %d";
		String name="liuzhongli";
		
		int age =24;
		String str=String.format(string, name, age);
		System.out.println(str);
		
		String query ="select * from user_detail where username='%s',age='%d';";
		query = String.format(query, name,age);
		System.out.println(query);
	}

}
